<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
    <head>
        <style type="text/css" media="all">
            @import "null?\"\{";
            @import "/css/style.css";
        </style>
        <script type="text/javascript" src="/js/jquery-1.4.2.min.js"></script>
        <script type="text/javascript" src="/js/jquery_ui/jquery-ui-1.8.custom.js"></script>

        <style type="text/css">
            input.mybutton {
                background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #bdf0cd), color-stop(1, #dfdfdf) );
                background:-moz-linear-gradient( center top, #bdf0cd 5%, #dfdfdf 100% );
                filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#bdf0cd', endColorstr='#dfdfdf');
                background-color:#bdf0cd;
                -moz-border-radius:9px;
                -webkit-border-radius:9px;
                border-radius:9px;
                display:inline-block;
                color:#000000;
                font-family:Arial;
                font-size:17px;
                font-weight:bold;
                padding:6px 11px;
                text-decoration:none;
            }input.mybutton:hover {
                background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #dfdfdf), color-stop(1, #bdf0cd) );
                background:-moz-linear-gradient( center top, #dfdfdf 5%, #bdf0cd 100% );
                filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#dfdfdf', endColorstr='#bdf0cd');
                background-color:#dfdfdf;
            }input.mybutton:active {
                position:relative;
                top:1px;
            }
            a.mybutton {
                background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #bdf0cd), color-stop(1, #dfdfdf) );
                background:-moz-linear-gradient( center top, #bdf0cd 5%, #dfdfdf 100% );
                filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#bdf0cd', endColorstr='#dfdfdf');
                background-color:#bdf0cd;
                -moz-border-radius:9px;
                -webkit-border-radius:9px;
                border-radius:9px;
                display:inline-block;
                color:#000000;
                font-family:Arial;
                font-size:17px;
                font-weight:bold;
                padding:6px 11px;
                text-decoration:none;
            }a.mybutton:hover {
                background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #dfdfdf), color-stop(1, #bdf0cd) );
                background:-moz-linear-gradient( center top, #dfdfdf 5%, #bdf0cd 100% );
                filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#dfdfdf', endColorstr='#bdf0cd');
                background-color:#dfdfdf;
            }a.mybutton:active {
                position:relative;
                top:1px;
            }
            /* This imageless css button was generated by CSSButtonGenerator.com */
            #mytable
            {
                font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
                width:100%;
                border-collapse:collapse;
            }
            #mytable td, #mytable th
            {
                font-size:1em;
                border:1px solid #98bf21;
                padding:3px 7px 2px 7px;
            }
            #mytable th
            {
                font-size:1.1em;
                text-align:center
                    padding-top:5px;
                padding-bottom:4px;
                background-color:#ffffff
                    color:#000000;
            }
            #mytable tr.alt td
            {
                color:#000000;
                background-color:#EAF2D3;
            }
            table.ex1{table-layout: fixed}
            select{width:100px}
        </style>
        <?php
        $title = "Texas Reservoir Water Data Database";

        $criteria = array('Variable', 'Source', 'Reservoir', 'Date From', 'Date To', 'Depth Range');
        ?>
        <title><? echo $title ?> </title>
    </head>
    <body>

        <div id="container">
           <div id="masthead"><!-- BEGINNING OF LOGO AND UPPER NAVIGATION REGION: MASTHEAD -->
                <a href="http://www.ttu.edu/" id="homelink" title="Return to TTU Home" name="top"></a>

                <span style=" color: white;position:relative;left:90px;top:30px;">USGS Texas Cooperative Fish and Wildlife Research Unit </span><br/>
                <span style=" color: white;position:relative;left:90px;top:40px;">Texas Reservoir Water Data Portal  </span>

            </div>
            <div id="sideBar">
                <ul><li>
                        <a href="/">Welcome</a>
                    </li>
                    <li><a href="../../index.php/basicquery/options">Raw Data</a></li>
                    <li><a href="../../index.php/welcome/userguide">Userguide</a></li>
                    <li><a href="../../index.php/welcome/document">Documents</a></li>
                    <li><a href="../../index.php/basicquery/desorcom">Processing/Analysis</a></li>
                </ul>
            </div>

            <div id="content">
               <?
                    if ($num_storage > 0) {

                        $temp_array = array_values($query_storage->result_array());
                        //for($i=0)
                        echo "<center>";
                       
                        echo "Number of Results: <b>" . $num_storage . " </b>";
                        echo "Period of Record: <b>";
                        echo substr($temp_array[0]["DATE"], -4) . "--" . substr($temp_array[count($temp_array) - 1]["DATE"], -4);
                        echo "</b>";
                        echo "</center>";

                        echo "<table border=1 align=center>";
                        echo "<tr>";
                        //fetch a single row:
			echo "<th>ID</th>";
			echo "<th>SHORTNAME</th>";
			echo "<th>SOURCE_PK</th>";
			echo "<th>EPOCH</th>";
			echo "<th>JULIAN</th>";
			echo "<th>DATE</th>";
			echo "<th>P00054</th>";
			echo "<th>P00054_STATCODE</th>";
			echo "<th>P00062</th>";
			echo "<th>P00062_STATCODE</th>";
                        echo "</tr>";
                        //output all the query result:
                        $item_num = 1;
                        foreach ($query_storage->result_array() as $row):
                            echo "<tr>";
                            for ($num_row_item = 0; $num_row_item < count($row); $num_row_item++) {
                                if ($num_row_item == 0) {
                                    echo "<td  align='center'>$item_num</td>";
                                } else {                           
                                        $row_array = array_values($row);
                                        echo "<td align='center'>";
                                        echo $row_array[$num_row_item];
                                        echo "</td>";
                                    }
                                }
                            echo "</tr>";
                            $item_num++;
                        endforeach;
                        echo "</table>";
                    }                    

                ?>

                <div id="footer">
                    <script language="javascript" type="text/javascript" src="js/dates.js"></script>
                    <p>
                        <a href="mailto:jaln.liu@ttu.edu">Contact the webmaster</a><br />
                        &copy;<script language="javascript" type="text/javascript">document.write(printYear());</script> <a href="http://www.ttu.edu">Texas Tech University</a> | All Rights Reserved |
                        <script language="javascript" type="text/javascript">document.write("Last Updated: " + modDate());</script>
                    </p>            </div>
            </div>
    </body>
</html>
